# 导包
import pymysql

# 创建链接
conn = pymysql.connect(host="211.103.136.244",
                       port=7061,
                       user="student",
                       password="iHRM_student_2021",
                       database="test_db",
                       charset="utf8")
# 创建游标
cursor = conn.cursor()
# 执行sql
cursor.execute("select version();")
print(cursor.fetchall())
# 关闭游标
cursor.close()
# 关闭链接
conn.close()
